using System;
using System.Linq.Expressions;
using LinqSpecs;

namespace PCE.Data.Queries.Customer
{
	public class WithEmail : Specification<Domain.Customer>
	{
		private readonly string _email;

		public WithEmail(string email)
		{
			_email = email.ToUpper();
		}

		public override Expression<Func<Domain.Customer, bool>> IsSatisfiedBy()
		{
			return c => c.Email.ToUpper() == _email;
		}
	}
}